#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "HFFormSectionModel.h"
#import "HFFormRowModel.h"
@class HFFormAdaptor, HFForm;
@protocol HFFormDelegate <NSObject>
@optional
- (NSDictionary * _Nonnull)replaceProperty;
- (NSArray <NSString *> * _Nonnull)ignoreKeys;
- (void)form:(HFForm * _Nonnull)form didSelectRowAtIndexPath:(NSIndexPath * _Nonnull)indexPath rowModel:(HFFormRowModel * _Nonnull)row tableViewCell:(UITableViewCell * _Nullable)cell;
- (void)form:(HFForm * _Nonnull)form didDeselectRowAtIndexPath:(NSIndexPath * _Nonnull)indexPath rowModel:(HFFormRowModel * _Nonnull)row tableViewCell:(UITableViewCell * _Nullable)cell;
- (void)form:(HFForm * _Nonnull)form setRowAtIndexPath:(NSIndexPath * _Nonnull)indexPath rowModel:(HFFormRowModel * _Nonnull)row tableViewCell:(UITableViewCell * _Nullable)cell;
- (BOOL)hasMoreDataInform;
@end
@interface HFForm : NSObject
@property (nonatomic, strong, nullable) HFFormAdaptor *adpator;
@property (nonatomic, weak, nullable) id<HFFormDelegate>delegate;
+ (HFFormSectionModel * _Nonnull)section;
+ (HFFormSectionModel * _Nonnull)sectionWithTitle:(NSString * _Nonnull)title;
+ (HFFormSectionModel * _Nonnull)sectionWithFooterTitle:(NSString * _Nonnull)title;
+ (HFFormSectionModel * _Nonnull)sectionWithTitle:(NSString * _Nonnull)title footerTitle:(NSString * _Nonnull)footer;
+ (HFFormRowModel * _Nonnull)row;
+ (HFFormRowModel * _Nonnull)rowWithType:(HFFormRowType)type;
- (HFFormSectionModel * _Nullable)getSectionWithKey:(NSString * _Nonnull)key;
- (NSArray * _Nullable)getAllRows;
- (NSArray * _Nullable)getRowWithKey:(NSString * _Nonnull)key;
- (void)appendSection:(HFFormSectionModel * _Nonnull)section;
- (void)appendSection:(HFFormSectionModel * _Nonnull)section atIndex:(NSUInteger)index;
- (void)appendRow:(HFFormRowModel * _Nonnull)row;
- (void)appendRows:(NSArray <HFFormRowModel *> *_Nonnull)rows below:(HFFormRowModel *_Nonnull)lastRow;
- (void)appendRow:(HFFormRowModel * _Nonnull)row inSection:(HFFormSectionModel * _Nonnull)section;
- (void)appendRows:(NSArray <HFFormRowModel *> * _Nonnull)rows inSection:(HFFormSectionModel * _Nonnull)section;
- (void)appendRows:(NSArray <HFFormRowModel *> * _Nonnull)rows inSection:(HFFormSectionModel * _Nonnull)section rowAtSection:(NSUInteger)index;
- (void)deleteSections:(NSArray <HFFormSectionModel *> * _Nonnull)sections;
- (void)deleteSectionWithKey:(NSString * _Nonnull)key;
- (void)deleteSectionWithIndex:(NSUInteger)index;
- (void)deleteRows:(NSArray <HFFormRowModel *> * _Nonnull)rows;
- (void)deleteRows:(NSArray <HFFormRowModel *> * _Nonnull)rows inSection:(HFFormSectionModel * _Nonnull)section;
- (void)deleRowWithKey:(NSString * _Nonnull)key;
- (HFFormSectionModel * _Nonnull)sectionOfIndex:(NSUInteger)index;
- (HFFormRowModel * _Nonnull)rowInSection:(HFFormSectionModel * _Nonnull)section ofIndex:(NSUInteger)index;
- (NSUInteger)totalSectionCount;
- (BOOL)containRow:(HFFormRowModel * _Nonnull)row;
- (void)reloadData;
- (void)reloadRow:(HFFormRowModel * _Nonnull)row;
- (void)reloadRows:(NSArray <HFFormRowModel *> * _Nonnull)rows;
- (void)reloadHeight;
- (NSDictionary * _Nullable)exportDataToDictionary;
- (id _Nullable)exportDataToObject:(id _Nonnull)object;
- (void)importData:(id _Nonnull)data;
- (NSDictionary * _Nullable)dictFromModel:(id _Nonnull)model;
- (BOOL)checkEditedWithModel:(id _Nullable)model;
- (BOOL)checkRowFinished;
- (void)clearData;
@end
